const {normalize, join, basename, dirname, extname, parse, format} = require('path');
//const normalize = require("path").normalize; //此句效果同 const {normalize} = require('path');

console.log(normalize('/usr//local/bin'));
console.log(normalize('/usr//local/../bin'));

console.log(join('/usr', 'local', 'bin/'));

const filePath = '/usr/local/bin/';
console.log(basename(filePath));
console.log(dirname(filePath));
console.log(extname(filePath));

const fileName = '/usr/local/bin/test.json';
const result = parse(fileName);
console.log(result);
console.log(format(result));


